<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		.father{
			position: relative;
		}
		.son{
			display: none;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son">
			
		</div>
		
	</div>
	<script type="text/javascript">
		// offserparent 代表的是指向最近的包含定位元素的祖辈元素  没有就指向body
		// 如果son为display:none的时候   返回的是null

		let son = document.querySelector('.son')
		console.log(son.offsetParent)
	</script>
</body>
</html>